package ir;

import java.util.Calendar;

public class MemberNode implements Generator {

  public String gen() {
    return null;
  }
  protected String gwtifyName(Class<?> type) {

    Class<?> candidateType;
    if (type.isArray()) {
      candidateType = type.getComponentType();
    }
    else
      candidateType = type;
    
    // filter for primitives and strings
    boolean qualified = false;
    if (! candidateType.isPrimitive() && ! 
        candidateType.equals(String.class)) {
      
      if (! candidateType.getName().contains("axis") && 
          !candidateType.getName().contains("java")) {
        
        qualified = true;
      }
    }
    
    if (candidateType.equals(Calendar.class))
      return "Date";

    if (qualified)
      return "Gwt" + type.getSimpleName();
    else return type.getSimpleName();
  }

}
